package day05.localDate;

import java.text.SimpleDateFormat;
import java.util.Calendar;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/4/25
 * 找出下个月的倒数第3天是哪天
 */
public class Test5 {
    public static void main(String[] args) {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.MONTH, 1);

        calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
        calendar.add(Calendar.DAY_OF_MONTH, -2);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
        System.out.println("下个月的倒数第 3 天是：" + sdf.format(calendar.getTime()));
    }
}
